package com.panshi.service.impl;

import com.panshi.dao.HomeDao;
import com.panshi.service.HomeService;
import com.panshi.vo.ArticleOkVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HomeServiceImpl implements HomeService {
    @Autowired
    HomeDao homeDao;


    @Override
    public int countHomePage() {
        return homeDao.countHomePage();
    }

    //分类的相关推荐
    @Override
    public List<ArticleOkVO> hotBot() {
        return homeDao.hotBot();
    }

    //主页 最新创作
    @Override
    public List<ArticleOkVO> listHomeNewArticleOkVOs() {
        return homeDao.listHomeNewArticleOkVOs();
    }

    @Override
    public List<ArticleOkVO> listHomeArticleOkVOs(Integer type, Integer page) {
        return homeDao.listHomeArticleOkVOs(type, page * 3 - 3);
    }
}
